﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _01.School
{
    public class School
    {
        private List<Class> classesList = new List<Class>();
        private string name;

        public School(List<Class> classesList, string name)
        {
            this.classesList = new List<Class>(classesList);
            this.name = name;
        }

        public string Name
        {
            get
            {
                return this.name;
            }

            set 
            {
                if (value.Length < 10)
                {
                    throw new ArgumentOutOfRangeException("The name of the school cannot be less then 10 letters");
                }
                this.name = value;
            }
        }

        public List<Class> ClassesList
        {
            get
            {
                return this.classesList;
            }        
        }

        public void AddClass(Class addedClass)
        {
            classesList.Add(addedClass);
        }
    }
}
